package com.swpu.library.sys.controller;


import com.swpu.library.sys.entity.User;
import com.swpu.library.sys.service.IUserService;
import com.swpu.library.sys.utils.ResponseUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author hui
 * @since 2020-11-23
 */
@RestController
@CrossOrigin
@RequestMapping("/sys/user")
public class UserController {
    @Autowired
    IUserService userService;
    @RequestMapping(value = "/login",method = RequestMethod.POST)
    public Object login(User user) {
        return ResponseUtils.login();
    }
    @RequestMapping(value ="/login",method = RequestMethod.GET)
    public Object login() {
        return "sunnc";
    }
    @RequestMapping(value = "/info",method = RequestMethod.GET)
    public Object info(String token) {
        return "admin";
    }
}
